package com.gang.ssm.bos.system.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.gang.ssm.bos.core.toolbox.ajax.AjaxResult;
import com.gang.ssm.bos.system.bean.Province;
import com.gang.ssm.bos.system.service.ProvinceService;

@RequestMapping("/province")
@Controller
public class ProvinceHandler extends BosController {
	
	@Autowired
	private ProvinceService provinceService;

	@ResponseBody
	@RequestMapping("/list")
	public AjaxResult findAll() {
		try {
			List<Province> provinces = provinceService.findAll();
			return success(provinces);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return fail("获取省份信息出错!");
	}
}
